<template>
  <el-card class="box-card">
    <div style="width: 500px">
      <el-image
        style="width: 100px; height: 100px"
        :src="require('@/assets/404_images/11.jpg')"
        fit="fill"
      ></el-image>
      <!-- <el-row>
      <el-button type="primary" class="but" @click="onClick"
        >子应用按钮</el-button
      >
    </el-row>

    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <div>通过localStorage获得的数据:{{ baseStorageInfo }}</div>
      <div>通过qiankun自身推荐的方式获取的数据:{{ baseData.eee }}</div>
      <el-button type="primary" @click="onSetLocalS">点击</el-button> -->
      <!-- <el-image
        style="width: 100px; height: 100px"
        :src="require('@/assets/404_images/11.jpg')"
        fit="fill"
      ></el-image> -->
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="活动名称">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="活动区域">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="即时配送">
          <el-switch v-model="form.delivery"></el-switch>
        </el-form-item>
        <el-form-item label="活动性质">
          <el-checkbox-group v-model="form.type">
            <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
            <el-checkbox label="地推活动" name="type"></el-checkbox>
            <el-checkbox label="线下主题活动" name="type"></el-checkbox>
            <el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="特殊资源">
          <el-radio-group v-model="form.resource">
            <el-radio label="线上品牌商赞助"></el-radio>
            <el-radio label="线下场地免费"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="活动形式">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
      </el-form>
      <!-- </el-dialog> -->
    </div>
  </el-card>
</template>

<script>
import actions from '@/qiankun/actions'

export default {
  name: 'dashboard',
  mixins: [],
  props: {},
  components: {},
  data() {
    return {
      dialogVisible: false,
      baseStorageInfo: '',
      baseData: {},
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: '',
      },
    }
  },
  methods: {
    onClick() {
      this.dialogVisible = true
    },
    handleClose(done) {
      this.dialogVisible = false
    },
    getInfo() {
      this.baseStorageInfo = localStorage.getItem('baseStorageInfo')
    },
    onSetLocalS() {
      localStorage.setItem('zi', '子应用存储的数据')
    },
    getAction() {
      actions.onGlobalStateChange &&
        actions.onGlobalStateChange((state, prev) => {
          this.baseData = state
        }, true)
    },
  },
  created() {
    this.getInfo()
    // this.getAction()
  },
  mounted() {},
  watch: {},
  computed: {},
  filters: {},
}
</script>

<style scoped lang="scss">
.but {
  color: yellow;
  font-size: 24px;
}
</style>
../../../../vue-admin-template-master-son/src/qiankun/actions
